package com.yunbiao.ybbusstopplate.ui.view.subway;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.view.View;

/* renamed from: com.tmindtech.subway.ui.StationEffect */
public class StationEffect extends View {
    /* access modifiers changed from: private */
    public boolean FlickerFlag;
    private Paint flagpaint = new Paint();
    private Thread thread = null;
    /* access modifiers changed from: private */
    public boolean threadFlag;



    public StationEffect(Context context) {
        super(context);
        this.flagpaint.setAntiAlias(true);


        this.flagpaint.setColor(Color.parseColor("#EB6100"));
//        this.flagpaint.setColor(Color.parseColor("#C52B24"));
        initThread();
    }

    /* access modifiers changed from: protected */
    public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        setMeasuredDimension(1920, 1080);
    }

    /* access modifiers changed from: protected */
    public void onDraw(Canvas canvas) {
        canvas.drawCircle(GlobalSetting.getInstance().icon_x, GlobalSetting.getInstance().icon_y, this.FlickerFlag ? GlobalSetting.getInstance().icon_r : 0.0f, this.flagpaint);
    }

    public void threadstop() {
        this.threadFlag = false;
        if (this.thread != null) {
            try {
                this.thread.interrupt();
                this.thread.join();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }

    private void initThread() {
        this.thread = new Thread(new Runnable() {
            public void run() {
                boolean unused = StationEffect.this.threadFlag = true;
                boolean unused2 = StationEffect.this.FlickerFlag = true;
                while (StationEffect.this.threadFlag) {
                    StationEffect.this.postInvalidate();
                    boolean unused3 = StationEffect.this.FlickerFlag = !StationEffect.this.FlickerFlag;
                    try {
                        Thread.sleep(500);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
            }
        });
        this.thread.start();
    }
}
